home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / astrocde.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  34KB  |  1,017 lines

  1. /****************************************************************************
  2.  
  3. Bally Astrocade style games
  4.  
  5. driver by Nicola Salmoria, Mike Coates, Frank Palazzolo
  6.  
  7. TODO:
  8. - support stereo sound in Gorf (and maybe others, Wow has 3 speakers)
  9.  
  10.  
  11. memory map (preliminary)
  12.  
  13. 0000-3fff ROM but also "magic" RAM (which processes data and copies it to the video RAM)
  14. 4000-7fff SCREEN RAM (bitmap)
  15. 8000-cfff ROM
  16. d000-d3ff STATIC RAM
  17.  
  18. I/O ports:
  19. IN:
  20. 08        intercept register (collision detector)
  21.           bit 0: intercept in pixel 3 in an OR or XOR write since last reset
  22.           bit 1: intercept in pixel 2 in an OR or XOR write since last reset
  23.           bit 2: intercept in pixel 1 in an OR or XOR write since last reset
  24.           bit 3: intercept in pixel 0 in an OR or XOR write since last reset
  25.           bit 4: intercept in pixel 3 in last OR or XOR write
  26.           bit 5: intercept in pixel 2 in last OR or XOR write
  27.           bit 6: intercept in pixel 1 in last OR or XOR write
  28.           bit 7: intercept in pixel 0 in last OR or XOR write
  29. 10        IN0
  30. 11        IN1
  31. 12        IN2
  32. 13        DSW
  33. 14          Video Retrace
  34. 15        ?
  35. 17        Speech Synthesizer (Output)
  36.  
  37. OUT:
  38. 00-07     palette (00-03 = right part of screen; 04-07 left part)
  39. 08        select video mode (0 = low res 160x102, 1 = high res 320x204)
  40. 09        --xxxxxx position where to switch from the "left" to the "right" palette (/2).
  41.           xx------ background color (portion of screen after vblank)
  42. 0a        screen height
  43. 0b        color block transfer
  44. 0c        magic RAM control
  45.           bit 7: ?
  46.           bit 6: flip
  47.           bit 5: draw in XOR mode
  48.           bit 4: draw in OR mode
  49.           bit 3: "expand" mode (convert 1bpp data to 2bpp)
  50.           bit 2: "rotate" mode (rotate 90 degrees - NOT EMULATED)
  51.           bit 1:\ shift amount to be applied before copying
  52.           bit 0:/
  53. 0d        set interrupt vector
  54. 10-18     sound
  55. 19        magic RAM expand mode color
  56. 78-7e     pattern board (see vidhrdw.c for details)
  57.  
  58. ****************************************************************************/
  59.  
  60. #include "driver.h"
  61. #include "vidhrdw/generic.h"
  62.  
  63. extern unsigned char *wow_videoram;
  64.  
  65. void astrocde_init_palette(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom);
  66. READ_HANDLER( wow_intercept_r );
  67. WRITE_HANDLER( wow_videoram_w );
  68. WRITE_HANDLER( astrocde_magic_expand_color_w );
  69. WRITE_HANDLER( astrocde_magic_control_w );
  70. WRITE_HANDLER( wow_magicram_w );
  71. WRITE_HANDLER( astrocde_pattern_board_w );
  72. void astrocde_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  73. READ_HANDLER( wow_video_retrace_r );
  74.  
  75. WRITE_HANDLER( astrocde_interrupt_enable_w );
  76. WRITE_HANDLER( astrocde_interrupt_w );
  77. int  wow_interrupt(void);
  78.  
  79. READ_HANDLER( seawolf2_controller1_r );
  80. READ_HANDLER( seawolf2_controller2_r );
  81. void seawolf2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  82.  
  83. int  gorf_interrupt(void);
  84. READ_HANDLER( gorf_timer_r );
  85. READ_HANDLER( gorf_io_r );
  86.  
  87. int  astrocde_vh_start(void);
  88. int  astrocde_stars_vh_start(void);
  89. void astrocde_vh_stop(void);
  90.  
  91. int  wow_sh_start(const struct MachineSound *msound);
  92. void wow_sh_update(void);
  93.  
  94. READ_HANDLER( wow_speech_r );
  95. READ_HANDLER( wow_port_2_r );
  96. READ_HANDLER( wow_io_r );
  97.  
  98. int  gorf_sh_start(const struct MachineSound *msound);
  99. void gorf_sh_update(void);
  100. READ_HANDLER( gorf_speech_r );
  101. READ_HANDLER( gorf_port_2_r );
  102. WRITE_HANDLER( gorf_sound_control_a_w );
  103.  
  104. WRITE_HANDLER( astrocde_mode_w );
  105. WRITE_HANDLER( astrocde_vertical_blank_w );
  106. WRITE_HANDLER( astrocde_colour_register_w );
  107. WRITE_HANDLER( astrocde_colour_split_w );
  108. WRITE_HANDLER( astrocde_colour_block_w );
  109.  
  110. WRITE_HANDLER( ebases_trackball_select_w );
  111. READ_HANDLER( ebases_trackball_r );
  112.  
  113.  
  114. static struct MemoryReadAddress seawolf2_readmem[] =
  115. {
  116.     { 0x0000, 0x1fff, MRA_ROM },
  117.     { 0x4000, 0x7fff, MRA_RAM },
  118.     { 0xc000, 0xcfff, MRA_RAM },
  119.     { -1 }    /* end of table */
  120. };
  121. static struct MemoryWriteAddress seawolf2_writemem[] =
  122. {
  123.     { 0x0000, 0x3fff, wow_magicram_w },
  124.     { 0x4000, 0x7fff, wow_videoram_w, &wow_videoram, &videoram_size },
  125.     { 0xc000, 0xcfff, MWA_RAM },
  126.     { -1 }    /* end of table */
  127. };
  128.  
  129. static struct MemoryReadAddress readmem[] =
  130. {
  131.     { 0x0000, 0x3fff, MRA_ROM },
  132.     { 0x4000, 0x7fff, MRA_RAM },
  133.     { 0x8000, 0xcfff, MRA_ROM },
  134.     { 0xd000, 0xdfff, MRA_RAM },
  135.     { -1 }    /* end of table */
  136. };
  137. static struct MemoryWriteAddress writemem[] =
  138. {
  139.     { 0x0000, 0x3fff, wow_magicram_w },
  140.     { 0x4000, 0x7fff, wow_videoram_w, &wow_videoram, &videoram_size },    /* ASG */
  141.     { 0x8000, 0xcfff, MWA_ROM },
  142.     { 0xd000, 0xdfff, MWA_RAM },
  143.     { -1 }    /* end of table */
  144. };
  145.  
  146. static struct MemoryReadAddress robby_readmem[] =
  147. {
  148.     { 0x0000, 0x3fff, MRA_ROM },
  149.     { 0x4000, 0x7fff, MRA_RAM },
  150.     { 0x8000, 0xdfff, MRA_ROM },
  151.     { 0xe000, 0xffff, MRA_RAM },
  152.     { -1 }    /* end of table */
  153. };
  154. static struct MemoryWriteAddress robby_writemem[] =
  155. {
  156.     { 0x0000, 0x3fff, wow_magicram_w },
  157.     { 0x4000, 0x7fff, wow_videoram_w, &wow_videoram, &videoram_size },
  158.     { 0x8000, 0xdfff, MWA_ROM },
  159.     { 0xe000, 0xffff, MWA_RAM },
  160.     { -1 }    /* end of table */
  161. };
  162.  
  163. static struct MemoryReadAddress profpac_readmem[] =
  164. {
  165.     { 0x0000, 0x3fff, MRA_ROM },
  166.     { 0x8000, 0xdfff, MRA_ROM },
  167.     { 0xe000, 0xffff, MRA_RAM },
  168.     { -1 }    /* end of table */
  169. };
  170. static struct MemoryWriteAddress profpac_writemem[] =
  171. {
  172.     { 0x0000, 0x3fff, wow_magicram_w },
  173.     { 0x4000, 0x7fff, wow_videoram_w, &wow_videoram, &videoram_size },
  174.     { 0x8000, 0xdfff, MWA_ROM },
  175.     { 0xe000, 0xffff, MWA_RAM },
  176.     { -1 }    /* end of table */
  177. };
  178.  
  179. static struct IOReadPort readport[] =
  180. {
  181.     { 0x08, 0x08, wow_intercept_r },
  182.     { 0x0e, 0x0e, wow_video_retrace_r },
  183.     { 0x10, 0x10, input_port_0_r },
  184.     { 0x11, 0x11, input_port_1_r },
  185.       { 0x12, 0x12, input_port_2_r },
  186.     { 0x13, 0x13, input_port_3_r },
  187.     { -1 }    /* end of table */
  188. };
  189.  
  190. static struct IOWritePort seawolf2_writeport[] =
  191. {
  192.     { 0x00, 0x07, astrocde_colour_register_w },
  193.     { 0x08, 0x08, astrocde_mode_w },
  194.     { 0x09, 0x09, astrocde_colour_split_w },
  195.     { 0x0a, 0x0a, astrocde_vertical_blank_w },
  196.     { 0x0b, 0x0b, astrocde_colour_block_w },
  197.     { 0x0c, 0x0c, astrocde_magic_control_w },
  198.     { 0x0d, 0x0d, interrupt_vector_w },
  199.     { 0x0e, 0x0e, astrocde_interrupt_enable_w },
  200.     { 0x0f, 0x0f, astrocde_interrupt_w },
  201.     { 0x19, 0x19, astrocde_magic_expand_color_w },
  202.     { -1 }    /* end of table */
  203. };
  204. static struct IOWritePort writeport[] =
  205. {
  206.     { 0x00, 0x07, astrocde_colour_register_w },
  207.     { 0x08, 0x08, astrocde_mode_w },
  208.     { 0x09, 0x09, astrocde_colour_split_w },
  209.     { 0x0a, 0x0a, astrocde_vertical_blank_w },
  210.     { 0x0b, 0x0b, astrocde_colour_block_w },
  211.     { 0x0c, 0x0c, astrocde_magic_control_w },
  212.     { 0x0d, 0x0d, interrupt_vector_w },
  213.     { 0x0e, 0x0e, astrocde_interrupt_enable_w },
  214.     { 0x0f, 0x0f, astrocde_interrupt_w },
  215.     { 0x10, 0x18, astrocade_sound1_w },
  216.     { 0x19, 0x19, astrocde_magic_expand_color_w },
  217.     { 0x50, 0x58, astrocade_sound2_w },
  218.     { 0x5b, 0x5b, MWA_NOP }, /* speech board ? Wow always sets this to a5*/
  219.     { 0x78, 0x7e, astrocde_pattern_board_w },
  220. /*    { 0xf8, 0xff, MWA_NOP }, */ /* Gorf uses these */
  221.     { -1 }    /* end of table */
  222. };
  223.  
  224.  
  225.  
  226. INPUT_PORTS_START( seawolf2 )
  227.     PORT_START /* IN0 */
  228.     PORT_ANALOG( 0x3f, 0x20, IPT_PADDLE | IPF_REVERSE | IPF_PLAYER1, 20, 5, 0, 0x3f)
  229.     PORT_DIPNAME( 0x40, 0x00, "Language 1" )
  230.     PORT_DIPSETTING(    0x00, "Language 2" )
  231.     PORT_DIPSETTING(    0x40, "French" )
  232.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  233.  
  234.     PORT_START /* IN1 */
  235.     PORT_ANALOG( 0x3f, 0x20, IPT_PADDLE | IPF_REVERSE | IPF_PLAYER2, 20, 5, 0, 0x3f)
  236.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  237.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  238.  
  239.     PORT_START /* IN2 */
  240.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  241.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 )
  242.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
  243.     PORT_DIPNAME( 0x08, 0x00, "Language 2" )
  244.     PORT_DIPSETTING(    0x00, "English" )
  245.     PORT_DIPSETTING(    0x08, "German" )
  246.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  247.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  248.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  249.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  250.  
  251.     PORT_START /* Dip Switch */
  252.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coinage ) )
  253.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  254.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
  255.     PORT_DIPNAME( 0x06, 0x00, "Play Time" )
  256.     PORT_DIPSETTING(    0x06, "40" )
  257.     PORT_DIPSETTING(    0x04, "50" )
  258.     PORT_DIPSETTING(    0x02, "60" )
  259.     PORT_DIPSETTING(    0x00, "70" )
  260.     PORT_DIPNAME( 0x08, 0x08, "2 Players Game" )
  261.     PORT_DIPSETTING(    0x00, "1 Credit" )
  262.     PORT_DIPSETTING(    0x08, "2 Credits" )
  263.     PORT_DIPNAME( 0x30, 0x00, "Extended Play" )
  264.     PORT_DIPSETTING(    0x10, "5000" )
  265.     PORT_DIPSETTING(    0x20, "6000" )
  266.     PORT_DIPSETTING(    0x30, "7000" )
  267.     PORT_DIPSETTING(    0x00, "None" )
  268.     PORT_DIPNAME( 0x40, 0x40, "Monitor" )
  269.     PORT_DIPSETTING(    0x40, "Color" )
  270.     PORT_DIPSETTING(    0x00, "B/W" )
  271.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  272. INPUT_PORTS_END
  273.  
  274. INPUT_PORTS_START( spacezap )
  275.     PORT_START /* IN0 */
  276.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  277.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  278.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  279.     PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
  280.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  281.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  282.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  283.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  284.  
  285.     PORT_START /* IN1 */
  286.  
  287.     PORT_START /* IN2 */
  288.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  289.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  290.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  291.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  292.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  293.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  294.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  295.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  296.  
  297.     PORT_START /* Dip Switch */
  298.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )
  299.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  300.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
  301.     PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )
  302.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  303.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
  304.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  305.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  306.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  307.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  308.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  309.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  310.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  311.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  312.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  313.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  314.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  315.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  316.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  317.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  318.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  319.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  320.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  321. INPUT_PORTS_END
  322.  
  323. INPUT_PORTS_START( ebases )
  324.     PORT_START /* IN0 */
  325.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  326.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
  327.     PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN )
  328.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  329.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  330.     PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
  331.  
  332.     PORT_START
  333.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  334.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  335.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT )
  336.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  337.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  338.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  339.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) )
  340.     PORT_DIPSETTING(    0x10, DEF_STR( Upright ) )    /* The colors are screwed up if selected */
  341.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  342.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  343.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  344.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  345.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  346.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  347.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  348.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  349.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  350.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  351.  
  352.     PORT_START /* Dip Switch */
  353.     PORT_DIPNAME( 0x01, 0x00, "2 Players Game" )
  354.     PORT_DIPSETTING(    0x00, "1 Credit" )
  355.     PORT_DIPSETTING(    0x01, "2 Credits" )
  356.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  357.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  358.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  359.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  360.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  361.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  362.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  363.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  364.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  365.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  366.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  367.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  368.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  369.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  370.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  371.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  372.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  373.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  374.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  375.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  376.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  377.  
  378.     PORT_START
  379.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_X | IPF_PLAYER2 | IPF_CENTER, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )    \
  380.  
  381.     PORT_START
  382.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_PLAYER2 | IPF_CENTER, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )    \
  383.  
  384.     PORT_START
  385.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_X | IPF_CENTER, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )    \
  386.  
  387.     PORT_START
  388.     PORT_ANALOGX( 0xff, 0x00, IPT_TRACKBALL_Y | IPF_CENTER, 50, 10, 0, 0, IP_KEY_NONE, IP_KEY_NONE, IP_JOY_NONE, IP_JOY_NONE )    \
  389. INPUT_PORTS_END
  390.  
  391. INPUT_PORTS_START( wow )
  392.     PORT_START /* IN0 */
  393.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  394.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  395.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  396.     PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
  397.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
  398.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  399.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  400.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )
  401.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  402.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  403.  
  404.     PORT_START /* IN1 */
  405.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_PLAYER2 )
  406.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_PLAYER2 )
  407.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_PLAYER2 )
  408.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  409.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  410.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  411.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  412.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  413.  
  414.     PORT_START /* IN2 */
  415.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  416.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  417.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  418.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  419.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  420.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
  421.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  422.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* speech status */
  423.  
  424.     PORT_START /* Dip Switch */
  425.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )
  426.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  427.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
  428.     PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )
  429.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  430.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
  431.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  432.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  433.     PORT_DIPNAME( 0x08, 0x08, "Language" )
  434.     PORT_DIPSETTING(    0x08, "English" )
  435.     PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )
  436.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
  437.     PORT_DIPSETTING(    0x10, "2 / 5" )
  438.     PORT_DIPSETTING(    0x00, "3 / 7" )
  439.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Bonus_Life ) )
  440.     PORT_DIPSETTING(    0x20, "3rd Level" )
  441.     PORT_DIPSETTING(    0x00, "4th Level" )
  442.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
  443.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  444.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  445.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  446.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  447.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  448. INPUT_PORTS_END
  449.  
  450. INPUT_PORTS_START( gorf )
  451.     PORT_START /* IN0 */
  452.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  453.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  454.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  455.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT )
  456.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
  457.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
  458.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Cabinet ) )
  459.     PORT_DIPSETTING(    0x40, DEF_STR( Upright ) )
  460.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  461.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  462.  
  463.     PORT_START /* IN1 */
  464.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  465.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  466.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  467.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  468.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  469.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  470.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  471.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  472.  
  473.     PORT_START /* IN2 */
  474.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  475.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  476.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  477.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  478.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  479.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  480.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  481.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* speech status */
  482.  
  483.     PORT_START /* Dip Switch */
  484.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Coin_A ) )
  485.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  486.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_1C ) )
  487.     PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coin_B ) )
  488.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
  489.     PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
  490.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
  491.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  492.     PORT_DIPNAME( 0x08, 0x08, "Language" )
  493.     PORT_DIPSETTING(    0x08, "English" )
  494.     PORT_DIPSETTING(    0x00, "Foreign (NEED ROM)" )
  495.     PORT_DIPNAME( 0x10, 0x00, "Lives per Credit" )
  496.     PORT_DIPSETTING(    0x10, "2" )
  497.     PORT_DIPSETTING(    0x00, "3" )
  498.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Bonus_Life ) )
  499.     PORT_DIPSETTING(    0x00, "Mission 5" )
  500.     PORT_DIPSETTING(    0x20, "None" )
  501.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
  502.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  503.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  504.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  505.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  506.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  507. INPUT_PORTS_END
  508.  
  509. INPUT_PORTS_START( robby )
  510.     PORT_START /* IN0 */
  511.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  512.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  513.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  514.     PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
  515.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT )
  516.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
  517.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
  518.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  519.  
  520.     PORT_START /* IN1 */
  521.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  522.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  523.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  524.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  525.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  526.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  527.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  528.  
  529.     PORT_START /* IN2 */
  530.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  531.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  532.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  533.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  534.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
  535.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  536.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  537.  
  538.     PORT_START /* Dip Switch */
  539.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  540.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  541.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  542.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  543.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  544.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  545.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )
  546.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  547.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  548.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
  549.     PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
  550.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  551.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  552.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  553.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  554.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  555.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  556.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  557.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  558.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  559.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  560.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  561.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  562.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  563. INPUT_PORTS_END
  564.  
  565.  
  566.  
  567. static struct Samplesinterface samples_interface =
  568. {
  569.     8,    /* 8 channels */
  570.     25    /* volume */
  571. };
  572.  
  573. static struct astrocade_interface astrocade_2chip_interface =
  574. {
  575.     2,            /* Number of chips */
  576.     1789773,    /* Clock speed */
  577.     {255,255}            /* Volume */
  578. };
  579.  
  580. static struct astrocade_interface astrocade_1chip_interface =
  581. {
  582.     1,            /* Number of chips */
  583.     1789773,    /* Clock speed */
  584.     {255}            /* Volume */
  585. };
  586.  
  587. static struct CustomSound_interface gorf_custom_interface =
  588. {
  589.     gorf_sh_start,
  590.     0,
  591.     gorf_sh_update
  592. };
  593.  
  594. static struct CustomSound_interface wow_custom_interface =
  595. {
  596.     wow_sh_start,
  597.     0,
  598.     wow_sh_update
  599. };
  600.  
  601.  
  602.  
  603.  
  604. static struct MachineDriver machine_driver_seawolf2 =
  605. {
  606.     /* basic machine hardware */
  607.     {
  608.         {
  609.             CPU_Z80,
  610.             1789773,    /* 1.789 Mhz */
  611.             seawolf2_readmem,seawolf2_writemem,readport,seawolf2_writeport,
  612.             wow_interrupt,256
  613.         }
  614.     },
  615.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  616.     1,    /* single CPU, no need for interleaving */
  617.     0,
  618.  
  619.     /* video hardware */
  620.     320, 204, { 0, 320-1, 0, 204-1 },
  621.     0,    /* no gfxdecodeinfo - bitmapped display */
  622.     256, 0,
  623.     astrocde_init_palette,
  624.  
  625.     VIDEO_TYPE_RASTER,
  626.     0,
  627.     astrocde_vh_start,
  628.     astrocde_vh_stop,
  629.     seawolf2_vh_screenrefresh,
  630.  
  631.     /* sound hardware */
  632.     0,0,0,0,
  633. };
  634.  
  635. static struct MachineDriver machine_driver_spacezap =
  636. {
  637.     /* basic machine hardware */
  638.     {
  639.         {
  640.             CPU_Z80,
  641.             1789773,    /* 1.789 Mhz */
  642.             readmem,writemem,readport,writeport,
  643.             wow_interrupt,256
  644.         }
  645.     },
  646.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  647.     1,    /* single CPU, no need for interleaving */
  648.     0,
  649.  
  650.     /* video hardware */
  651.     320, 204, { 0, 320-1, 0, 204-1 },
  652.     0,    /* no gfxdecodeinfo - bitmapped display */
  653.     256, 0,
  654.     astrocde_init_palette,
  655.  
  656.     VIDEO_TYPE_RASTER,
  657.     0,
  658.     astrocde_vh_start,
  659.     astrocde_vh_stop,
  660.     astrocde_vh_screenrefresh,
  661.  
  662.     /* sound hardware */
  663.     0,0,0,0,
  664.     {
  665.         {
  666.             SOUND_ASTROCADE,
  667.             &astrocade_2chip_interface
  668.         }
  669.     }
  670. };
  671.  
  672. static struct MachineDriver machine_driver_ebases =
  673. {
  674.     /* basic machine hardware */
  675.     {
  676.         {
  677.             CPU_Z80,
  678.             1789773,    /* 1.789 Mhz */
  679.             readmem,writemem,readport,writeport,
  680.             wow_interrupt,256
  681.         }
  682.     },
  683.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  684.     1,    /* single CPU, no need for interleaving */
  685.     0,
  686.  
  687.     /* video hardware */
  688.     320, 204, { 0, 320-1, 0, 204-1 },
  689.     0,    /* no gfxdecodeinfo - bitmapped display */
  690.     256, 0,
  691.     astrocde_init_palette,
  692.  
  693.     VIDEO_TYPE_RASTER,
  694.     0,
  695.     astrocde_vh_start,
  696.     astrocde_vh_stop,
  697.     astrocde_vh_screenrefresh,
  698.  
  699.     /* sound hardware */
  700.     0,0,0,0,
  701.     {
  702.         {
  703.             SOUND_ASTROCADE,
  704.             &astrocade_1chip_interface
  705.         }
  706.     }
  707. };
  708.  
  709. static struct MachineDriver machine_driver_wow =
  710. {
  711.     /* basic machine hardware */
  712.     {
  713.         {
  714.             CPU_Z80,
  715.             1789773,    /* 1.789 Mhz */
  716.             readmem,writemem,readport,writeport,
  717.             wow_interrupt,256
  718.         }
  719.     },
  720.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  721.     1,    /* single CPU, no need for interleaving */
  722.     0,
  723.  
  724.     /* video hardware */
  725.     320, 204, { 0, 320-1, 0, 204-1 },
  726.     0,    /* no gfxdecodeinfo - bitmapped display */
  727.     256, 0,
  728.     astrocde_init_palette,
  729.  
  730.     VIDEO_TYPE_RASTER,
  731.     0,
  732.     astrocde_stars_vh_start,
  733.     astrocde_vh_stop,
  734.     astrocde_vh_screenrefresh,
  735.  
  736.     /* sound hardware */
  737.     0,0,0,0,
  738.     {
  739.         {
  740.             SOUND_ASTROCADE,
  741.             &astrocade_2chip_interface
  742.         },
  743.         {
  744.             SOUND_SAMPLES,
  745.             &samples_interface
  746.         },
  747.         {
  748.             SOUND_CUSTOM,    /* actually plays the samples */
  749.             &wow_custom_interface
  750.         }
  751.      }
  752. };
  753.  
  754. static struct MachineDriver machine_driver_gorf =
  755. {
  756.     /* basic machine hardware */
  757.     {
  758.         {
  759.             CPU_Z80,
  760.             1789773,    /* 1.789 Mhz */
  761.             readmem,writemem,readport,writeport,
  762.             gorf_interrupt,256
  763.         }
  764.     },
  765.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  766.     1,    /* single CPU, no need for interleaving */
  767.     0,
  768.  
  769.     /* video hardware */
  770.     /* it may look like the right hand side of the screen needs clipping, but */
  771.     /* this isn't the case: cocktail mode would be clipped on the wrong side */
  772.  
  773.     320, 204, { 0, 320-1, 0, 204-1 },
  774.     0,    /* no gfxdecodeinfo - bitmapped display */
  775.     256, 0,
  776.     astrocde_init_palette,
  777.  
  778.     VIDEO_TYPE_RASTER,
  779.     0,
  780.     astrocde_stars_vh_start,
  781.     astrocde_vh_stop,
  782.     astrocde_vh_screenrefresh,
  783.  
  784.     /* sound hardware */
  785.     0,0,0,0,
  786.     {
  787.         {
  788.             SOUND_ASTROCADE,
  789.             &astrocade_2chip_interface
  790.         },
  791.         {
  792.             SOUND_SAMPLES,
  793.             &samples_interface
  794.         },
  795.         {
  796.             SOUND_CUSTOM,    /* actually plays the samples */
  797.             &gorf_custom_interface
  798.         }
  799.     }
  800. };
  801.  
  802. static struct MachineDriver machine_driver_robby =
  803. {
  804.     /* basic machine hardware */
  805.     {
  806.         {
  807.             CPU_Z80,
  808.             1789773,    /* 1.789 Mhz */
  809.             robby_readmem,robby_writemem,readport,writeport,
  810.             wow_interrupt,256
  811.         }
  812.     },
  813.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  814.     1,    /* single CPU, no need for interleaving */
  815.     0,
  816.  
  817.     /* video hardware */
  818.     320, 204, { 0, 320-1, 0, 204-1 },
  819.     0,    /* no gfxdecodeinfo - bitmapped display */
  820.     256, 0,
  821.     astrocde_init_palette,
  822.  
  823.     VIDEO_TYPE_RASTER,
  824.     0,
  825.     astrocde_vh_start,
  826.     astrocde_vh_stop,
  827.     astrocde_vh_screenrefresh,
  828.  
  829.     /* sound hardware */
  830.     0,0,0,0,
  831.     {
  832.         {
  833.             SOUND_ASTROCADE,
  834.             &astrocade_2chip_interface
  835.         }
  836.     }
  837. };
  838.  
  839. static struct MachineDriver machine_driver_profpac =
  840. {
  841.     /* basic machine hardware */
  842.     {
  843.         {
  844.             CPU_Z80,
  845.             1789773,    /* 1.789 Mhz */
  846.             profpac_readmem,profpac_writemem,readport,writeport,
  847.             wow_interrupt,256
  848.         }
  849.     },
  850.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  851.     1,    /* single CPU, no need for interleaving */
  852.     0,
  853.  
  854.     /* video hardware */
  855.     320, 204, { 0, 320-1, 0, 204-1 },
  856.     0,    /* no gfxdecodeinfo - bitmapped display */
  857.     256, 0,
  858.     astrocde_init_palette,
  859.  
  860.     VIDEO_TYPE_RASTER,
  861.     0,
  862.     astrocde_vh_start,
  863.     astrocde_vh_stop,
  864.     astrocde_vh_screenrefresh,
  865.  
  866.     /* sound hardware */
  867.     0,0,0,0,
  868.     {
  869.         {
  870.             SOUND_ASTROCADE,
  871.             &astrocade_2chip_interface
  872.         }
  873.     }
  874. };
  875.  
  876.  
  877.  
  878. ROM_START( seawolf2 )
  879.     ROM_REGION( 0x10000, REGION_CPU1 )
  880.     ROM_LOAD( "sw2x1.bin",    0x0000, 0x0800, 0xad0103f6 )
  881.     ROM_LOAD( "sw2x2.bin",    0x0800, 0x0800, 0xe0430f0a )
  882.     ROM_LOAD( "sw2x3.bin",    0x1000, 0x0800, 0x05ad1619 )
  883.     ROM_LOAD( "sw2x4.bin",    0x1800, 0x0800, 0x1a1a14a2 )
  884. ROM_END
  885.  
  886. ROM_START( spacezap )
  887.     ROM_REGION( 0x10000, REGION_CPU1 )
  888.     ROM_LOAD( "0662.01",      0x0000, 0x1000, 0xa92de312 )
  889.     ROM_LOAD( "0663.xx",      0x1000, 0x1000, 0x4836ebf1 )
  890.     ROM_LOAD( "0664.xx",      0x2000, 0x1000, 0xd8193a80 )
  891.     ROM_LOAD( "0665.xx",      0x3000, 0x1000, 0x3784228d )
  892. ROM_END
  893.  
  894. ROM_START( ebases )
  895.     ROM_REGION( 0x10000, REGION_CPU1 )
  896.     ROM_LOAD( "m761a",        0x0000, 0x1000, 0x34422147 )
  897.     ROM_LOAD( "m761b",        0x1000, 0x1000, 0x4f28dfd6 )
  898.     ROM_LOAD( "m761c",        0x2000, 0x1000, 0xbff6c97e )
  899.     ROM_LOAD( "m761d",        0x3000, 0x1000, 0x5173781a )
  900. ROM_END
  901.  
  902. ROM_START( wow )
  903.     ROM_REGION( 0x10000, REGION_CPU1 )
  904.     ROM_LOAD( "wow.x1",       0x0000, 0x1000, 0xc1295786 )
  905.     ROM_LOAD( "wow.x2",       0x1000, 0x1000, 0x9be93215 )
  906.     ROM_LOAD( "wow.x3",       0x2000, 0x1000, 0x75e5a22e )
  907.     ROM_LOAD( "wow.x4",       0x3000, 0x1000, 0xef28eb84 )
  908.     ROM_LOAD( "wow.x5",       0x8000, 0x1000, 0x16912c2b )
  909.     ROM_LOAD( "wow.x6",       0x9000, 0x1000, 0x35797f82 )
  910.     ROM_LOAD( "wow.x7",       0xa000, 0x1000, 0xce404305 )
  911. /*    ROM_LOAD( "wow.x8",       0xc000, 0x1000, ? )    here would go the foreign language ROM */
  912. ROM_END
  913.  
  914. ROM_START( gorf )
  915.     ROM_REGION( 0x10000, REGION_CPU1 )
  916.     ROM_LOAD( "gorf-a.bin",   0x0000, 0x1000, 0x5b348321 )
  917.     ROM_LOAD( "gorf-b.bin",   0x1000, 0x1000, 0x62d6de77 )
  918.     ROM_LOAD( "gorf-c.bin",   0x2000, 0x1000, 0x1d3bc9c9 )
  919.     ROM_LOAD( "gorf-d.bin",   0x3000, 0x1000, 0x70046e56 )
  920.     ROM_LOAD( "gorf-e.bin",   0x8000, 0x1000, 0x2d456eb5 )
  921.     ROM_LOAD( "gorf-f.bin",   0x9000, 0x1000, 0xf7e4e155 )
  922.     ROM_LOAD( "gorf-g.bin",   0xa000, 0x1000, 0x4e2bd9b9 )
  923.     ROM_LOAD( "gorf-h.bin",   0xb000, 0x1000, 0xfe7b863d )
  924. ROM_END
  925.  
  926. ROM_START( gorfpgm1 )
  927.     ROM_REGION( 0x10000, REGION_CPU1 )
  928.     ROM_LOAD( "873a",         0x0000, 0x1000, 0x97cb4a6a )
  929.     ROM_LOAD( "873b",         0x1000, 0x1000, 0x257236f8 )
  930.     ROM_LOAD( "873c",         0x2000, 0x1000, 0x16b0638b )
  931.     ROM_LOAD( "873d",         0x3000, 0x1000, 0xb5e821dc )
  932.     ROM_LOAD( "873e",         0x8000, 0x1000, 0x8e82804b )
  933.     ROM_LOAD( "873f",         0x9000, 0x1000, 0x715fb4d9 )
  934.     ROM_LOAD( "873g",         0xa000, 0x1000, 0x8a066456 )
  935.     ROM_LOAD( "873h",         0xb000, 0x1000, 0x56d40c7c )
  936. ROM_END
  937.  
  938. ROM_START( robby )
  939.     ROM_REGION( 0x10000, REGION_CPU1 )
  940.     ROM_LOAD( "rotox1.bin",   0x0000, 0x1000, 0xa431b85a )
  941.     ROM_LOAD( "rotox2.bin",   0x1000, 0x1000, 0x33cdda83 )
  942.     ROM_LOAD( "rotox3.bin",   0x2000, 0x1000, 0xdbf97491 )
  943.     ROM_LOAD( "rotox4.bin",   0x3000, 0x1000, 0xa3b90ac8 )
  944.     ROM_LOAD( "rotox5.bin",   0x8000, 0x1000, 0x46ae8a94 )
  945.     ROM_LOAD( "rotox6.bin",   0x9000, 0x1000, 0x7916b730 )
  946.     ROM_LOAD( "rotox7.bin",   0xa000, 0x1000, 0x276dc4a5 )
  947.     ROM_LOAD( "rotox8.bin",   0xb000, 0x1000, 0x1ef13457 )
  948.       ROM_LOAD( "rotox9.bin",   0xc000, 0x1000, 0x370352bf )
  949.     ROM_LOAD( "rotox10.bin",  0xd000, 0x1000, 0xe762cbda )
  950. ROM_END
  951.  
  952. ROM_START( profpac )
  953.     ROM_REGION( 0x10000, REGION_CPU1 )
  954.     ROM_LOAD( "pps1",         0x0000, 0x2000, 0xa244a62d )
  955.     ROM_LOAD( "pps2",         0x2000, 0x2000, 0x8a9a6653 )
  956.     ROM_LOAD( "pps7",         0x8000, 0x2000, 0xf9c26aba )
  957.     ROM_LOAD( "pps8",         0xa000, 0x2000, 0x4d201e41 )
  958.     ROM_LOAD( "pps9",         0xc000, 0x2000, 0x17a0b418 )
  959.  
  960.     ROM_REGION( 0x04000, REGION_USER1 )
  961.     ROM_LOAD( "pps3",         0x0000, 0x2000, 0x15717fd8 )
  962.     ROM_LOAD( "pps4",         0x0000, 0x2000, 0x36540598 )
  963.     ROM_LOAD( "pps5",         0x0000, 0x2000, 0x8dc89a59 )
  964.     ROM_LOAD( "pps6",         0x0000, 0x2000, 0x5a2186c3 )
  965.     ROM_LOAD( "ppq1",         0x0000, 0x4000, 0xdddc2ccc )
  966.     ROM_LOAD( "ppq2",         0x0000, 0x4000, 0x33bbcabe )
  967.     ROM_LOAD( "ppq3",         0x0000, 0x4000, 0x3534d895 )
  968.     ROM_LOAD( "ppq4",         0x0000, 0x4000, 0x17e3581d )
  969.     ROM_LOAD( "ppq5",         0x0000, 0x4000, 0x80882a93 )
  970.     ROM_LOAD( "ppq6",         0x0000, 0x4000, 0xe5ddaee5 )
  971.     ROM_LOAD( "ppq7",         0x0000, 0x4000, 0xc029cd34 )
  972.     ROM_LOAD( "ppq8",         0x0000, 0x4000, 0xfb3a1ac9 )
  973.     ROM_LOAD( "ppq9",         0x0000, 0x4000, 0x5e944488 )
  974.     ROM_LOAD( "ppq10",        0x0000, 0x4000, 0xed72a81f )
  975.     ROM_LOAD( "ppq11",        0x0000, 0x4000, 0x98295020 )
  976.     ROM_LOAD( "ppq12",        0x0000, 0x4000, 0xe01a8dbe )
  977.     ROM_LOAD( "ppq13",        0x0000, 0x4000, 0x87165d4f )
  978.     ROM_LOAD( "ppq14",        0x0000, 0x4000, 0xecb861de )
  979. ROM_END
  980.  
  981.  
  982.  
  983. static void init_seawolf2(void)
  984. {
  985.     install_port_read_handler(0, 0x10, 0x10, seawolf2_controller2_r);
  986.     install_port_read_handler(0, 0x11, 0x11, seawolf2_controller1_r);
  987. }
  988. static void init_ebases(void)
  989. {
  990.     install_port_read_handler (0, 0x13, 0x13, ebases_trackball_r);
  991.     install_port_write_handler(0, 0x28, 0x28, ebases_trackball_select_w);
  992. }
  993. static void init_wow(void)
  994. {
  995.     install_port_read_handler(0, 0x12, 0x12, wow_port_2_r);
  996.     install_port_read_handler(0, 0x15, 0x15, wow_io_r);
  997.     install_port_read_handler(0, 0x17, 0x17, wow_speech_r);
  998. }
  999. static void init_gorf(void)
  1000. {
  1001.     install_mem_read_handler (0, 0xd0a5, 0xd0a5, gorf_timer_r);
  1002.  
  1003.     install_port_read_handler(0, 0x12, 0x12, gorf_port_2_r);
  1004.     install_port_read_handler(0, 0x15, 0x16, gorf_io_r);
  1005.     install_port_read_handler(0, 0x17, 0x17, gorf_speech_r);
  1006. }
  1007.  
  1008.  
  1009. GAMEX(1978, seawolf2, 0,    seawolf2, seawolf2, seawolf2, ROT0,   "Midway", "Sea Wolf II", GAME_NO_SOUND )
  1010. GAME( 1980, spacezap, 0,    spacezap, spacezap, 0,        ROT0,   "Midway", "Space Zap" )
  1011. GAME( 1980, ebases,   0,    ebases,   ebases,   ebases,   ROT0,   "Midway", "Extra Bases" )
  1012. GAME( 1980, wow,      0,    wow,      wow,      wow,      ROT0,   "Midway", "Wizard of Wor" )
  1013. GAME( 1981, gorf,     0,    gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf" )
  1014. GAME( 1981, gorfpgm1, gorf, gorf,     gorf,     gorf,     ROT270, "Midway", "Gorf (Program 1)" )
  1015. GAME( 1981, robby,    0,    robby,    robby,    0,        ROT0,   "Bally Midway", "Robby Roto" )
  1016. GAME( 1983, profpac,  0,    profpac,  gorf,     0,        ROT0,   "Bally Midway", "Professor PacMan" )
  1017.